namespace Microsoft.Services.TestTools.UITesting.Html {
    using System;

    /// <summary>
    /// Decorate your <see cref="Page"/> with this attribute to set its relative entry Uri.
    /// </summary>
    /// <remarks>
    /// The base Uri is handeled by the exported <see cref="IWebUITestConfiguration"/> type
    /// </remarks>
    /// <example>
    /// The page launcher will navigate to {baseUri}/Account/LogOn
    /// <code>
    /// [EntryUri("/Account/LogOn")]
    /// public class LogOn : Page {
    /// //impl omitted
    /// }
    /// </code>
    /// </example>
    [AttributeUsage(AttributeTargets.Class)]
    public class EntryUriAttribute : Attribute {

        /// <summary>
        /// Initializes a new instance of the <see cref="EntryUriAttribute"/> class.
        /// </summary>
        /// <param name="relativeUri">The relative entry Uri.</param>
        public EntryUriAttribute(string relativeUri) {
            RelativeUri = new RelativeUri(relativeUri);
        }

        /// <summary>
        /// Gets the relative Uri.
        /// </summary>
        public Uri RelativeUri { get; private set; }
    }
} 